<wxs module="dateFr" src="../../js/filter.wxs"></wxs>
<import src="../detail/detail" />
<template is="{{template}}" data="{{my_toast_tip: my_toast_tip}}" />
<view id="scan">
    <view class="home_top">
        <label class="del_style" bindtap="cleanAll">清空</label>
        <label class="input_style" bindtap="showInput">手动输入条码</label>
    </view>
    <view style="width:750rpx;height:2rpx;background:#ededed;"></view>
    <view class="msg" wx:if="{{!obj.cartItems.length}}">购物车空空的,添加点商品吧</view>
    <view id="goods">
        <view class="goods_style" wx:for="{{obj.cartItems}}" bindlongtap="longTap" bindtouchstart="touchStart" bindtouchend="touchEnd" data-code="{{item.goods.goodsCode}}" data-name="{{item.goods.goodsName}}">
            <view class="good_msg">
                <image wx:if="{{item.goods.imgUrl==null}}" src="{{urlAddress}}/xiaomai.jpg" />
                <image wx:if="{{item.goods.imgUrl!=null}}" src="{{item.goods.imgUrl}}" />
                <label class="name">{{item.goods.goodsName}}</label>
                <label class="money">
                    <label class="price">
                        ¥{{dateFr.getNum(item.goods.price)}}
                        <span class="originalPrice" wx:if="{{item.goods.price!=item.goods.originalPrice&item.goods.promotionType!=7}}">{{dateFr.getNum(item.goods.originalPrice)}} <view class="line"></view></span>
                    </label>
                </label>
                <view class="add_sub_style">
                    <label data-code="{{item.goods.goodsGbk}}" bindtap="addAction">
                        <image src="{{urlAddress}}/sub.png" />
                    </label>
                    <label>{{item.num}}</label>
                    <label data-code="{{item.goods.goodsGbk}}" bindtap="subAction">
                        <image src="{{urlAddress}}/add.png" />
                    </label>
                </view>
            </view>
            <!--活动类型-->
            <view class="activity" wx:if="{{item.promotionType==7||item.promotionType==9}}">
                <label></label>
                <span wx:if="{{item.promotionType==7}}" class="promotions">{{item.promotionAlias}}</span>
                <span wx:if="{{item.promotionType==9}}" class="assemblage"><span>组</span>{{item.promotionAlias}}</span>
            </view>
        </view>
    </view>
    <view style="width:100%;height:360rpx;background:white;"></view>
    <view id="show_view">
        <view class="border_style"></view>
        <view id="scanView" bindtap="scanAction">
            <label>点我扫</label>
            <span>商品条码</span>
        </view>
    </view>
    <div id="footer">
        <div wx:if="{{obj.cartItems.length!=0}}" id="submit" bindtap="submitAction">结算({{obj.cartItems.length}})</div>
        <div wx:if="{{obj.cartItems.length==0}}" id="submit">结算(0)</div>
        <div id="money" wx:if="{{obj.cartItems.length!=0&obj.savingPrice>0}}">
            <label>合计:¥{{dateFr.getNum(obj.promotionPrice)}}</label><span>已立减:¥{{dateFr.getNum(obj.savingPrice)}}</span></div>
        <div id="money_saveNull" wx:if="{{obj.cartItems.length!=0&obj.savingPrice==0}}">
            <label>合计:¥{{dateFr.getNum(obj.promotionPrice)}}</label>
        </div>
    </div>
</view>
<view wx:if="{{isShow}}" id='float_view'>
    <view id='input_view'>
        <input placeholder="请输入条码" type="number" bindinput="CodeInput" focus/>
        <span></span>
        <label id="cancel" bindtap="cancelAction">取消</label>
        <label id="makeSure" bindtap="makeSure">确认</label>
    </view>
</view>